#image-encoding #avif #av1 #convert #image-format #cav1f #rav1f

ravif

rav1e-based pure Rust library for encoding images in AVIF format (powers the cavif tool)

11 releases

0.11.5 Mar 14, 2024
0.11.3 Sep 21, 2023
0.11.2 May 9, 2023
0.11.1 Jan 24, 2023
0.6.3 Oct 18, 2020

#543 in Images

Download history 2723/week @ 2024-01-18 1987/week @ 2024-01-25 1363/week @ 2024-02-01 2546/week @ 2024-02-08 2489/week @ 2024-02-15 2375/week @ 2024-02-22 2529/week @ 2024-02-29 6555/week @ 2024-03-07 22529/week @ 2024-03-14 36426/week @ 2024-03-21 34870/week @ 2024-03-28 34356/week @ 2024-04-04 35790/week @ 2024-04-11 35494/week @ 2024-04-18 42224/week @ 2024-04-25 42254/week @ 2024-05-02

160,769 downloads per month
Used in 15 crates (7 directly)

BSD-3-Clause

37KB
659 lines

ravif — Pure Rust library for AVIF image encoding

Encoder for AVIF images. Based on rav1e and avif-serialize.

The API is just a single encode_rgba function call that spits an AVIF image.

This library powers cavif encoder. It has encoding configuration specifically tuned for still images, and gives better quality/performance than stock rav1e.


lib.rs:

use ravif::*;
let res = Encoder::new()
    .with_quality(70.)
    .with_speed(4)
    .encode_rgba(Img::new(pixels, width, height))?;
std::fs::write("hello.avif", res.avif_file);

Dependencies

~14MB
~345K SLoC